package com.project.easy.common.framework.web.config;

import com.project.easy.common.framework.auth.core.IQueryUser;
import com.project.easy.common.framework.auth.core.IToken;
import com.project.easy.common.framework.auth.core.impl.memory.MemoryQueryUser;
import com.project.easy.common.framework.web.service.impl.login.DefaultToken;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author GreatorMan.cool
 * @copyright: Copyright (c) 2020
 * @company: 扬起科技有限公司
 * @date 2021/11/23 22:23
 * @description:  登陆配置
 */
@Configuration
public class LoginConfig {


    @Bean
    @ConditionalOnMissingBean(IQueryUser.class)
    public MemoryQueryUser getMemoryQueryUser() {
        return new MemoryQueryUser();
    }

    @Bean
    @ConditionalOnMissingBean(IToken.class)
    public DefaultToken getDefaultToken() {
        return new DefaultToken();
    }

}
